<!--{include(pe_tpl('header.html'));}-->
<div class="right_page">
	<div class="now">
		<a href="admin.php?mod=cashout" <!--{if(!$_g_state):}-->class="sel"<!--{endif;}-->>待审核（{$tongji[0]}）<i></i></a>
		<a href="admin.php?mod=cashout&state=1" <!--{if($_g_state==1):}-->class="sel"<!--{endif;}-->>已审核（{$tongji[1]}）<i></i></a>
		<a href="admin.php?mod=cashout&state=2" <!--{if($_g_state==2):}-->class="sel"<!--{endif;}-->>已取消（{$tongji[2]}）<i></i></a>
		<a href="javascript:;" class="corg" style="float:right">金额总计：{$tongji['allmoney']}元，共：{$tongji['allnum']}笔</a>
		<div class="clear"></div>
	</div>
	<div class="right_main">
		<div class="search">
			<form method="get" autocomplete="off">
				<input type="hidden" name="mod" value="{$_g_mod}" />
				<input type="hidden" name="state" value="{$_g_state}" />
				用户账号：<input type="text" name="name" value="{$_g_name}" class="inputtext input100 mar5" />
				姓名：<input type="text" name="banktname" value="{$_g_banktname}" class="inputtext input100 mar5" />
				卡号：<input type="text" name="banknum" value="{$_g_banknum}" class="inputtext input100 mar5" />
				申请日期：<input type="text" name="date1" value="{$_g_date1}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate inputtext input100" />	
				至 <input type="text" name="date2" value="{$_g_date2}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate inputtext input100" />	
				<select name="bankname" class="selectmini">
				<option value="">= 账户类型 =</option>
				<!--{foreach($ini['userbank_type'] as $k=>$v):}-->
				<option value="{$v}" <!--{if($_g_bankname==$v):}-->selected="selected"<!--{endif;}-->>[<!--{echo ++$kkk}-->]{$v}</option>
				<!--{endforeach;}-->
				</select>
				<input type="submit" value="搜索" class="input_btn" />
				<input type="button" value="导出" class="input_btn" id="export_btn" />
			</form>
		</div>
		<form method="post" id="form">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list">
		<tr>
			<th class="bgtt" width="20"><input type="checkbox" name="checkall" onclick="pe_checkall(this, 'cashout_id')" /></th>
			<th class="bgtt" width="120">申请日期</th>
			<th class="bgtt" width="130">用户账号</th>
			<th class="bgtt" width="150">结款金额</th>
			<th class="bgtt">收款账户</th>
			<th class="bgtt" width="120">用户IP</th>
			<th class="bgtt" width="100">审核日期</th>
			<th class="bgtt" width="150">审核状态</th>
		</tr>
		<!--{foreach($info_list as $v):}-->
		<tr>
			<td><input type="checkbox" name="cashout_id[]" value="{$v['cashout_id']}"></td>
			<td>{pe_date_color(pe_date($v['cashout_atime']))}</td>
			<td>{$v['user_name']}</td>
			<td>
				<p class="corg strong">{$v['cashout_jsmoney']}</p>
				<!--{if($v['cashout_fee']>0):}--><p class="tag_gray mat5">已扣：{$v['cashout_fee']}</p><!--{endif;}-->
			</td>
			<td class="left">
				<p>类型：{$v['cashout_bankname']}<!--{if($v['cashout_bankaddress']):}--><span class="c999">（{$v['cashout_bankaddress']}）</span><!--{endif;}--></p>
				<p>卡号：{$v['cashout_banknum']}</p>
				<p>姓名：{$v['cashout_banktname']}</p>
			</td>
			<td>{$v['cashout_ip']}</td>
			<td>{pe_date_color(pe_date($v['cashout_ptime'], 'm-d H:i'))}</td>
			<td>
				<!--{if($v['cashout_state'] == 1):}-->
				<img src="{$pe['host_tpl']}image/dui.png" />
				<!--{elseif($v['cashout_state'] == 2):}-->
				<del class="cbbb">已取消</del>
				<p class="corg">{$v['cashout_closetext']}</p>
				<!--{else:}-->
				<a href="javascript:pe_confirm('结算完成', 'admin.php?mod=cashout&act=success&id={$v['cashout_id']}')" class="admin_edit mar3">通过</a>
				<!--<a href="javascript:pe_confirm('取消结算', 'admin.php?mod=cashout&act=refuse&id={$v['cashout_id']}')" class="admin_del">取消</a>-->
				<a href="javascript:cancel_btn('{$v['cashout_id']}')" class="admin_del">取消</a>
				<!--{endif;}-->
			</td>
		</tr>
		<!--{endforeach;}-->
		</table>
		</form>
	</div>
	<div class="right_bottom">
		<!--{if(!$_g_state):}-->
		<span class="fl">
			<input type="checkbox" name="checkall" onclick="pe_checkall(this, 'cashout_id')" />
			<input type="button" onclick="pe_checksel('cashout_id') && pe_confirm('批量通过', 'admin.php?mod=cashout&act=success', 'cashout_id')" value="批量通过" />
		</span>
		<!--{endif;}-->
		<span class="fr fenye">{$db->page->html}</span>
		<div class="clear"></div>
	</div>
</div>
<script type="text/javascript" src="{$pe['host']}include/plugin/my97/WdatePicker.js"></script>
<script type="text/javascript">
$(function(){
	$("#export_btn").click(function(){
		pe_open("{pe_nowurl()}&act=export&type="+$(this).attr("data-type"));
	})
})
function cancel_btn(id) {
	layer.prompt({
		formType: 2,
		title: '请填写取消原因',
		area: ['300px', '100px'] //自定义文本域宽高
	}, function(value, index, elem){
		pe_get("admin.php?mod=cashout&act=refuse&id="+id+"&closetext="+encodeURIComponent(value), function(json){
			if (json.code == 1) {
				pe_open('reload', 500);
				layer.close(index);
			}
		})	
	});
}
</script>
<!--{include(pe_tpl('footer.html'));}-->